package com.black.common.feign;

import com.black.common.vo.ShareUserVo;
import com.black.common.web.ApiResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Set;

/**
 * @author linwenfeng
 */
@FeignClient(name = "platform-service")
public interface PlatformFeignClient {

    @GetMapping("/shareUser/findUserByUsername")
    ApiResponse<ShareUserVo> findUserByUsername(@RequestParam("username") String username);

    @GetMapping("/permission/getAllPermissionsByUser")
    ApiResponse<Set<String>> getAllPermissionsByUser(@RequestParam("systemCode") String systemCode);

    @GetMapping("/permission/getAllDataPermissionsByUser")
    ApiResponse<Set<String>> getAllDataPermissionsByUser(@RequestParam("systemCode") String systemCode);

    @GetMapping("/shareUser/getAllPermissionsByUser")
    ApiResponse<Set<String>> getUserDataPower();

    @GetMapping("/shareUser/findUserByOtherId")
    ApiResponse<ShareUserVo> findUserByOtherId(@RequestParam("otherId") String otherId,@RequestParam("idType")String idType);

    @PostMapping("/shareUser/register")
    ApiResponse<ShareUserVo> register(@RequestBody ShareUserVo shareUserVo);
}
